import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'

Vue.use(Router)

export default new Router({
    routes: [
        {
            // 第一个页面
            path: '/',
            name: 'index',
            component: resolve => require(['../components/login/Index.vue'], resolve)
        }, {
            // 商家中心登录页面
            path: '/login',
            name: 'login',
            // component: resolve => require(['../components/page/Login.vue'], resolve)
            component: resolve => require(['../components/login/Login.vue'], resolve)
        }, {
            // 我要开店登录页面
            path: '/loginNestOne',
            name: 'loginNestOne',
            component: resolve => require(['../components/login/LoginNestOne.vue'], resolve)
        }, {
            // 我要供货登录页面
            path: '/loginNestTwo',
            name: 'loginNestTwo',
            component: resolve => require(['../components/login/LoginNestTwo.vue'], resolve)
        }, {
            // 我要开店页面
            path: '/setShop',
            name: 'setShop',
            component: resolve => require(['../components/login/SetShop.vue'], resolve)
        }, {
            // 我要供货页面
            path: '/setGoods',
            name: 'setGoods',
            component: resolve => require(['../components/login/setGoods.vue'], resolve)
        }, {
            // 忘记密码页面
            path: '/lostPassword',
            name: 'lostPassword',
            component: resolve => require(['../components/login/LostPassword.vue'], resolve)
        }, {
            // 商品发布第一个页面选择类目
            path: '/selectKind',
            name: 'selectKind',
            component: resolve => require(['../components/goodsOn/selectKind.vue'], resolve),
        },{
            // 商品发布页面
            path: '/goodsOn',
            name: 'goodsOn',
            component: resolve => require(['../components/goodsOn/index.vue'], resolve),
        },{
            // 注册页面
            path: '/register',
            component: resolve => require(['../components/register/index.vue'], resolve),
            children:[{
                    path: '/',
                    name: 'registerOne',
                    component: resolve => require(['../components/register/RegisterOne.vue'], resolve),
                    meta: { title: '绑定手机号' }
                }, {
                    path: '/registerTwo',
                    name: 'registerTwo',
                    component: resolve => require(['../components/register/RegisterTwo.vue'], resolve),
                    meta: { title: '填写账号信息' }
                }, {
                    path: '/registerThree',
                    name: 'registerThree',
                    component: resolve => require(['../components/register/RegisterThree.vue'], resolve),
                    meta: { title: '设置支付方式' }
                }, {
                    path: '/registerFour',
                    name: 'registerFour',
                    component: resolve => require(['../components/register/RegisterFour.vue'], resolve),
                    meta: { title: '注册成功' }
                }]
        },{
            // 商家中心页面
            path: '/shopIndex',
            component: resolve => require(['../components/shopCenter/index.vue'], resolve),
            children: [{
                    path: '/',
                    name: 'SCflow',
                    component: resolve => require(['../components/shopCenter/SCflow.vue'], resolve),
                    meta: { title: '流量中心' }
                }, {
                    path: '/SCcaller',
                    name: 'SCcaller',
                    component: resolve => require(['../components/shopCenter/SCcaller.vue'], resolve),
                    meta: { title: '访客中心' }
                }, {
                    path: '/SCdeal',
                    name: 'SCdeal',
                    component: resolve => require(['../components/shopCenter/SCdeal.vue'], resolve),
                    meta: { title: '交易中心' },
                    children:[{
                        // 空页面
                        path: '/',
                        component: resolve => require(['../components/SCdeal/index.vue'], resolve),
                        meta: { title: '交易总览' },
                    },{
                        path: '/SCdeal/SCdealA',
                        name:'SCdealA',
                        component: resolve => require(['../components/SCdeal/SCdealA.vue'], resolve),
                        meta: { title: '代付款' },
                    },{
                        path: '/SCdeal/SCdealB',
                        name:'SCdealB',
                        component: resolve => require(['../components/SCdeal/SCdealB.vue'], resolve),
                        meta: { title: '待发货' },
                    },{
                        path: '/SCdeal/SCdealC',
                        name:'SCdealC',
                        component: resolve => require(['../components/SCdeal/SCdealC.vue'], resolve),
                        meta: { title: '待退款售后' },
                    },{
                        path: '/SCdeal/SCdealD',
                        name:'SCdealD',
                        component: resolve => require(['../components/SCdeal/SCdealD.vue'], resolve),
                        meta: { title: '待评价' },
                    },{
                        path: '/SCdeal/SCdealE',
                        name:'SCdealE',
                        component: resolve => require(['../components/SCdeal/SCdealE.vue'], resolve),
                        meta: { title: '物流异常' },
                    },{
                        path: '/SCdeal/SCdealF',
                        name:'SCdealF',
                        component: resolve => require(['../components/SCdeal/SCdealF.vue'], resolve),
                        meta: { title: '总交易数量' },
                    }]
                }, {
                    path: '/SCsucceed',
                    name: 'SCsucceed',
                    component: resolve => require(['../components/shopCenter/SCsucceed.vue'], resolve),
                    meta: { title: '成交中心' }
                }, {
                    path: '/SCpercent',
                    name: 'SCpercent',
                    component: resolve => require(['../components/shopCenter/SCpercent.vue'], resolve),
                    meta: { title: '转化率' }
                }, {
                    path: '/SCactivity',
                    name: 'SCactivity',
                    component: resolve => require(['../components/shopCenter/SCactivity.vue'], resolve),
                    meta: { title: '活动中心' }
                }, {
                    path: '/Money',
                    name: 'Money',
                    component: resolve => require(['../components/SAccountCapital/Money.vue'], resolve),
                    meta: { title: '账户资金' },
                }, {
                    path: '/SAccountCapital/subMoney',
                    name: 'subMoney',
                    component: resolve => require(['../components/SAccountCapital/subMoney.vue'], resolve),
                    meta: { title: '提现内容' }
                },{
                    path: '/SAccountCapital/deposit',
                    name: 'deposit',
                    component: resolve => require(['../components/SAccountCapital/deposit.vue'], resolve),
                    meta: { title: '提交保证金' }
                },{
                    path: '/SAccountCapital/subSuccess',
                    name: 'subSuccess',
                    component: resolve => require(['../components/SAccountCapital/subSuccess.vue'], resolve),
                    meta: { title: '提交保证金成功' }
                }]
        }, {
            path: '/myYC',
            component: resolve => require(['../components/myYC/index.vue'], resolve),
            children: [{
                    path: '/',
                    name: 'myBaby',
                    component: resolve => require(['../components/myYC/myBaby.vue'], resolve),
                    meta: { title: '宝贝分类管理' }
                }, {
                    path: '/myStoreInfo',
                    name: 'myStoreInfo',
                    component: resolve => require(['../components/myYC/myStoreInfo.vue'], resolve),
                    meta: { title: '店铺基础信息' }
                }, {
                    path: '/myGoodsReviews',
                    name: 'myGoodsReviews',
                    component: resolve => require(['../components/myYC/myGoodsReviews.vue'], resolve),
                    meta: { title: '评价' }
                }]
        }, {
           path: '/activityCenter',
            component: resolve => require(['../components/activityCenter/index.vue'], resolve),
            children: [{
                path: '/',
                name: 'allActivity',
                component: resolve => require(['../components/activityCenter/allActivity.vue'], resolve),
                meta: { title: '全部活动' }
            }, {
                path: '/myActivity',
                name: 'myActivity',
                component: resolve => require(['../components/activityCenter/myActivity.vue'], resolve),
                meta: { title: '已报活动' }
            }]
        },{
            path: '/HelloWorld',
            name: 'HelloWorld',
            component: HelloWorld
        }, {
            path: '/404',
            component: resolve => require(['../components/page/404.vue'], resolve)
        },
    ]
})
